﻿<%@ Page Title="" Language="C#" MasterPageFile="~/WebmasterTool/Admin.Master" AutoEventWireup="true"
    CodeBehind="ProductAdd.aspx.cs" Inherits="Framework.WebmasterTool.Products.ProductAdd" %>

<%@ Register Src="../../Controls/simpleImageUploadUserControl/SimpleImageUpload.ascx"
    TagName="SimpleImageUpload" TagPrefix="uc1" %>
<%@ Register src="../../Resources/Watermark.ascx" tagname="Watermark" tagprefix="uc2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <script type="text/javascript">
        $(document).ready(function () {
            var num = 0;
            $(function () {
                $('#<%= PhotoFile.ClientID %>').MultiFile({
                    afterFileAppend: function (element, value, master_element) {
                        $(".MultiFile-label:last").children(":last").after(
                        "<br/><table><tr><td>Tiêu đề: </td><td><input id='Title" + num + "' type='text' name='Title" + num + "' style='width:250px' /></td></tr>" +
                        "<tr><td>Tiêu đề(en): </td><td><input id='Title_en" + num + "' type='text' name='Title_en" + num + "' style='width:250px' /></td></tr>" +
                        "<tr><td>Alt ảnh: </td><td><input id='Alt" + num + "' type='text' name='Alt" + num + "' style='width:250px' /></td></tr></table>"
                        );
                        num++;
                        $("#<%= hdfNumImage.ClientID %>").val(num);
                    },
                    accept: 'gif|jpg|jpeg|png|bmp',
                    STRING: {
                        remove: '[Xoá]',
                        denied: 'Chỉ chấp nhận định dạng file ảnh. Không chấp nhận kiểu file $ext',
                        duplicate: 'Đã tồn tại file: \n$file'
                    }
                });
            });
            //delete image cate
            $("a[ImageID]").live("click", function () {
                var ImageID = $(this).attr("ImageID");
                jConfirm('Chắc chắn xoá?', 'Digisky Confirm Dialog', function (r) {
                    if (r) {
                        $.ajax({
                            type: "POST",
                            url: "ProductAdd.aspx/DeleteImageProduct",
                            data: JSON.stringify({ ImageID: ImageID }),
                            contentType: "application/json; charset=utf-8",
                            async: false,
                            dataType: "json",
                            success: function (response) {
                                $("table[ImageID=" + ImageID + "]").remove();
                            },
                            error: function (xhr, ajaxOptions, thrownError) {
                                jAlert(thrownError);
                            }
                        });
                    }
                });
            });
            //jeditable
            $(".jeditable").live("hover", function () {
                $(this).editable(function (value, settings) {
                    var ImageID = $(this).attr("ImageID");
                    var NewValue = value;
                    var Attribute = $(this).attr("attribute");
                    $.ajax({
                        type: "POST",
                        url: "ProductAdd.aspx/EditAttributeImageProduct",
                        data: JSON.stringify({ ImageID: ImageID, NewValue: NewValue, Attribute: Attribute }),
                        contentType: "application/json; charset=utf-8",
                        async: false,
                        dataType: "json",
                        success: function (response) {
                        },
                        error: function (xhr, ajaxOptions, thrownError) {
                            jAlert(thrownError);
                        }
                    });
                    return value;
                },
                {
                    event: 'dblclick',
                    type: 'text',
                    select: true,
                    width: '150',
                    loadtype: 'POST',
                    cancel: 'Huỷ',
                    submit: 'Lưu',
                    tooltip: 'double click để thay đổi'
                });
            });
        });
    </script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#spanClearDateFrom").click(function () {
                $("#<%= txtRealeaseDate.ClientID %>").val("");
            });
            $("#spanClearDateTo").click(function () {
                $("#<%= txtExpireDate.ClientID %>").val("");
            });
            //tag plugin
            $('#<%= txtRelateTop.ClientID %>').tagsInput({
                autocomplete_url: '/Resources/GetTagListArticle.ashx',
                delimiter: '~',
                defaultText: 'Thêm mới'
            });
            $('#<%= txtRelateBottom.ClientID %>').tagsInput({
                autocomplete_url: '/Resources/GetTagListArticle.ashx',
                delimiter: '~',
                defaultText: 'Thêm mới'
            });
            $('#<%= txtRelateProduct.ClientID %>').tagsInput({
                autocomplete_url: '/Resources/GetTagListProduct.ashx',
                delimiter: '~',
                defaultText: 'Thêm mới'
            });
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ctlCaption" runat="Server">
    Thêm mới và cập nhật sản phẩm
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="PageContent" runat="Server">
    <asp:Label ID="lblPermissionMessage" runat="server" Font-Bold="true" ForeColor="Red"
        Text="Tài khoản không có quyền truy cập vào trang này" Visible="false"></asp:Label>
    <asp:Panel ID="Panel1" runat="server" Visible="true">
        <asp:HiddenField ID="hdfNumImage" runat="server" Value="0" />
        <table align="center" cellpadding="7" cellspacing="0" border="0">
            <tr>
                <td valign="top" colspan="2" align="center">
                    <asp:ValidationSummary ID="ValidationSummary1" runat="server" Font-Bold="true" DisplayMode="List"
                        ValidationGroup="ProductAdd" />
                    <asp:Label runat="server" ID="lblMsg" ForeColor="red" Font-Bold="true"></asp:Label>
                </td>
            </tr>
            <tr>
                <td>
                </td>
                <td>
                    <uc2:Watermark ID="Watermark1" runat="server" />
                </td>
            </tr>
            <tr>
                <td align="right" style="font-weight: bold">
                    Danh mục:
                </td>
                <td align="left">
                    <asp:DropDownList runat="server" ID="ddlCategories" Width="250px">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td align="right" style="font-weight: bold">
                    Tên sản phẩm:
                </td>
                <td align="left">
                    <asp:TextBox ID="txtTitle" runat="server" Width="300px" />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtTitle"
                        Display="Dynamic" ErrorMessage="Chưa chọn tên sản phẩm" ValidationGroup="ProductAdd">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr runat="server" visible="true">
                <td align="right" style="font-weight: bold">
                    Tên sản phẩm(en):
                </td>
                <td align="left">
                    <asp:TextBox ID="txtTitle_en" runat="server" Width="300px" />
                </td>
            </tr>
            <tr runat="server" visible="true">
                <td align="right" style="font-weight: bold">
                    Mã sản phẩm:
                </td>
                <td align="left">
                    <asp:TextBox ID="txtProductCode" runat="server" Width="300px" />
                </td>
            </tr>
            <tr>
                <td align="right" style="font-weight: bold">
                    Nhà sản xuất:
                </td>
                <td align="left">
                    <asp:TextBox ID="txtManufacturer" runat="server" Width="300px" />
                </td>
            </tr>
            <tr runat="server" visible="true">
                <td align="right" style="font-weight: bold">
                    Size sản phẩm:
                </td>
                <td align="left">
                    <asp:TextBox ID="txtSize" runat="server" Width="300px" />
                </td>
            </tr>
            <tr runat="server" visible="true">
                <td align="right" style="font-weight: bold">
                    Số lượng sản phẩm:
                </td>
                <td align="left">
                    <asp:TextBox ID="txtUnitInStock" runat="server" Width="300px" Text="0" />
                    <asp:RangeValidator ID="RangeValidator2" runat="server" ControlToValidate="txtUnitInStock"
                        Type="Integer" MinimumValue="0" MaximumValue="9999" ValidationGroup="ProductAdd"
                        ErrorMessage="Số lượng sản phẩm phải từ 0 đến 9999" Display="Dynamic">*</asp:RangeValidator>
                </td>
            </tr>
            <tr runat="server" visible="true">
                <td align="right" style="font-weight: bold">
                    Giá gốc:
                </td>
                <td align="left">
                    <asp:TextBox ID="txtUnitPrice" runat="server" Width="300px" Text="0" />
                    <asp:RangeValidator ID="RangeValidator3" runat="server" ControlToValidate="txtUnitPrice"
                        ErrorMessage="Giá gốc phải từ 0 đến 999999999999" MaximumValue="999999999999"
                        MinimumValue="0" Type="Double" ValidationGroup="ProductAdd" Display="Dynamic">*</asp:RangeValidator>
                    (Đơn vị: VND)
                </td>
            </tr>
            <tr runat="server" visible="true">
                <td align="right" style="font-weight: bold">
                    Giá bán:
                </td>
                <td align="left">
                    <asp:TextBox ID="txtSalePrice" runat="server" Width="300px" Text="0" />
                    <asp:RangeValidator ID="RangeValidator4" runat="server" ControlToValidate="txtSalePrice"
                        ErrorMessage="Giá bán phải từ 0 đến 999999999999" MaximumValue="999999999999"
                        MinimumValue="0" Type="Double" ValidationGroup="ProductAdd" Display="Dynamic">*</asp:RangeValidator>
                    (Đơn vị: VND)
                </td>
            </tr>
            <tr runat="server" visible="true">
                <td align="right" style="font-weight: bold">
                    Giá khuyến mãi:
                </td>
                <td align="left">
                    <asp:TextBox ID="txtPromotionPrice" runat="server" Width="300px" Text="0" />
                    <asp:RangeValidator ID="RangeValidator5" runat="server" ControlToValidate="txtPromotionPrice"
                        ErrorMessage="Giá khuyến mãi phải từ 0 đến 999999999999" MaximumValue="999999999999"
                        MinimumValue="0" Type="Double" ValidationGroup="ProductAdd" Display="Dynamic">*</asp:RangeValidator>
                    (Đơn vị: VND)
                </td>
            </tr>
            <tr runat="server" visible="true">
                <td align="right" style="font-weight: bold">
                    % khuyến mãi:
                </td>
                <td align="left">
                    <asp:TextBox ID="txtPromotionPercent" runat="server" Width="300px" Text="0" />
                    <asp:RangeValidator ID="RangeValidator6" runat="server" ControlToValidate="txtPromotionPercent"
                        ErrorMessage="Giá khuyến mãi phải từ 0 đến 100" MaximumValue="100" MinimumValue="0"
                        Type="Integer" ValidationGroup="ProductAdd" Display="Dynamic">*</asp:RangeValidator>
                    (Đơn vị: %)
                </td>
            </tr>
            <tr runat="server" visible="true">
                <td align="right" style="font-weight: bold">
                    Bảo hành:
                </td>
                <td align="left">
                    <asp:TextBox ID="txtWarranty" runat="server" Width="300px" Text="0" />
                    <asp:RangeValidator ID="RangeValidator7" runat="server" ControlToValidate="txtWarranty"
                        ErrorMessage="Ngày bảo hành phải từ 0 đến 9999" MaximumValue="9999" MinimumValue="0"
                        Type="Integer" ValidationGroup="ProductAdd" Display="Dynamic">*</asp:RangeValidator>
                    (Đơn vị: Ngày)
                </td>
            </tr>
            <tr>
                <td align="right" valign="middle" style="font-weight: bold">
                    Mô tả:
                </td>
                <td align="left">
                    <CKEditor:CKEditorControl ID="txtSummary" runat="server" UIColor="#CED9F3" Width="600"
                        Height="200" Toolbar="Basic" BasePath="/Plugins/Ckeditor" ContentsCss="/Plugins/Ckeditor/contents.css"
                        TemplatesFiles="/Plugins/Ckeditor/plugins/templates/templates/default.js">
                    </CKEditor:CKEditorControl>
                </td>
            </tr>
            <tr runat="server" visible="true">
                <td align="right" style="font-weight: bold" valign="middle">
                    Mô tả(en):
                </td>
                <td align="left">
                    <CKEditor:CKEditorControl ID="txtSummary_en" runat="server" UIColor="#CED9F3" Width="600"
                        Height="200" Toolbar="Basic" BasePath="/Plugins/Ckeditor" ContentsCss="/Plugins/Ckeditor/contents.css"
                        TemplatesFiles="/Plugins/Ckeditor/plugins/templates/templates/default.js">
                    </CKEditor:CKEditorControl>
                </td>
            </tr>
            <tr runat="server" visible="true">
                <td align="right" style="font-weight: bold" valign="middle">
                    Tính năng:
                </td>
                <td align="left">
                    <CKEditor:CKEditorControl ID="txtFeature" runat="server" UIColor="#CED9F3" Width="600"
                        Height="200" Toolbar="Basic" BasePath="/Plugins/Ckeditor" ContentsCss="/Plugins/Ckeditor/contents.css"
                        TemplatesFiles="/Plugins/Ckeditor/plugins/templates/templates/default.js">
                    </CKEditor:CKEditorControl>
                </td>
            </tr>
            <tr runat="server" visible="true">
                <td align="right" style="font-weight: bold" valign="middle">
                    Tính năng(en):
                </td>
                <td align="left">
                    <CKEditor:CKEditorControl ID="txtFeature_en" runat="server" UIColor="#CED9F3" Width="600"
                        Height="200" Toolbar="Basic" BasePath="/Plugins/Ckeditor" ContentsCss="/Plugins/Ckeditor/contents.css"
                        TemplatesFiles="/Plugins/Ckeditor/plugins/templates/templates/default.js">
                    </CKEditor:CKEditorControl>
                </td>
            </tr>
            <tr>
                <td align="right" style="font-weight: bold" valign="middle">
                    Meta Description:
                </td>
                <td align="left">
                    <asp:TextBox ID="txtMetaDescription" runat="server" Height="100px" TextMode="MultiLine"
                        Width="600px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td align="right" style="font-weight: bold" valign="middle">
                    Meta Keywords:
                </td>
                <td align="left">
                    <asp:TextBox ID="txtMetaKeywords" runat="server" Height="100px" TextMode="MultiLine"
                        Width="600px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td align="right" style="font-weight: bold" valign="middle">
                    Meta Title:
                </td>
                <td align="left">
                    <asp:TextBox ID="txtMetaTitle" runat="server" Height="100px" TextMode="MultiLine"
                        Width="600px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td align="right" style="font-weight: bold" valign="middle">
                    Meta khác và script:
                </td>
                <td align="left">
                    <asp:TextBox ID="txtMetaOrther" runat="server" Height="100px" TextMode="MultiLine"
                        Width="600px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td align="right" style="font-weight: bold">
                    Hình đại diện:
                    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                        <ContentTemplate>
                            <asp:CheckBox ID="chkWatermarkImage" runat="server" Text="Chèn chữ ký:" AutoPostBack="true"
                                OnCheckedChanged="chkWatermarkImage_CheckedChanged" />
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </td>
                <td>
                    <uc1:SimpleImageUpload ID="siuImage" runat="server" CssClass="ImageUpload" AutoOpenImageEditPopupAfterUpload="true" />
                    <br />
                    Kích thước ảnh: Width 585 x Height 340<br />
                    Thuộc tính alt ảnh đại diện:
                    <asp:TextBox ID="txtImageAlt" runat="server" Width="300"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td valign="top" colspan="2" align="center">
                    <div>
                        <div>
                            <b>Upload nhiều ảnh cho sản phẩm</b><br />
                            Kích thước ảnh: Width 585 x Height 340<br />
                        </div>
                        <br />
                        <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                            <ContentTemplate>
                                <asp:CheckBox ID="chkWatermarkImage2" runat="server" Text="Chèn chữ ký:" />
                            </ContentTemplate>
                        </asp:UpdatePanel>
                        <asp:FileUpload runat="server" ID="PhotoFile" Width="217px" />
                    </div>
                    <div id="ListImage" style="margin-top: 20px;">
                        <asp:DataList ID="dtlImage" runat="server" RepeatDirection="Horizontal" RepeatColumns="3"
                            Width="100%">
                            <ItemTemplate>
                                <table imageid='<%# Eval("ImageID") %>' border="0" style="width: 260px;">
                                    <tr>
                                        <td bgcolor="white" align="center" style="width: 100%; height: 100px">
                                            <img style="border: solid 2px white; width: 150px; max-height: 90px;" src='<%# DGSFramework.Globals.ApplicationPath + "UserUpload/Products/" + Eval("ImageUrl") %>'
                                                alt="" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="center" style="padding-top: 3pt; padding-bottom: 10px;" valign="top">
                                            <table>
                                                <tr>
                                                    <td align="left">
                                                        Tiêu đề:
                                                    </td>
                                                    <td class="jeditable" imageid='<%# Eval("ImageID") %>' attribute="title">
                                                        <%# Eval("Title")%>
                                                    </td>
                                                </tr>
                                                <tr runat="server" visible="false">
                                                    <td align="left">
                                                        Tiêu đề(en):
                                                    </td>
                                                    <td class="jeditable" imageid='<%# Eval("ImageID") %>' attribute="title_en">
                                                        <%# Eval("Title_en")%>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="left">
                                                        Alt ảnh:
                                                    </td>
                                                    <td class="jeditable" imageid='<%# Eval("ImageID") %>' attribute="alt">
                                                        <%# Eval("ImageAlt")%>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="2" align="center">
                                                        <a imageid='<%# Eval("ImageID") %>' style="cursor: pointer">[xóa]</a>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </ItemTemplate>
                        </asp:DataList>
                    </div>
                </td>
            </tr>
            <tr>
                <td align="right" valign="top" style="font-weight: bold">
                    Chi tiết sản phẩm:
                </td>
                <td align="left">
                    <CKEditor:CKEditorControl ID="txtDescription" runat="server" UIColor="#CED9F3" Width="600"
                        Height="200" Toolbar="Full" BasePath="/Plugins/Ckeditor" ContentsCss="/Plugins/Ckeditor/contents.css"
                        TemplatesFiles="/Plugins/Ckeditor/plugins/templates/templates/default.js">
                    </CKEditor:CKEditorControl>
                </td>
            </tr>
            <tr runat="server" visible="true">
                <td align="right" style="font-weight: bold" valign="top">
                    Chi tiết sản phẩm(en):
                </td>
                <td align="left">
                    <CKEditor:CKEditorControl ID="txtDescription_en" runat="server" UIColor="#CED9F3"
                        Width="600" Height="200" Toolbar="Full" BasePath="/Plugins/Ckeditor" ContentsCss="/Plugins/Ckeditor/contents.css"
                        TemplatesFiles="/Plugins/Ckeditor/plugins/templates/templates/default.js">
                    </CKEditor:CKEditorControl>
                </td>
            </tr>
            <tr>
                <td align="right" style="font-weight: bold">
                    Tin liên quan(trên):
                </td>
                <td align="left">
                    <asp:TextBox runat="server" ID="txtRelateTop" TextMode="MultiLine" Width="600" Height="50"></asp:TextBox>
                    <br />
                    Mỗi tin cách bởi dấu phẩy(~). Ex: soc ~ doc ~ la
                </td>
            </tr>
            <tr>
                <td align="right" style="font-weight: bold">
                    Tin liên quan(dưới):
                </td>
                <td align="left">
                    <asp:TextBox runat="server" ID="txtRelateBottom" TextMode="MultiLine" Width="600"
                        Height="50"></asp:TextBox>
                    <br />
                    Mỗi tin cách bởi dấu phẩy(~). Ex: soc ~ doc ~ la
                </td>
            </tr>
            <tr>
                <td align="right" style="font-weight: bold">
                    Sản phẩm liên quan:
                </td>
                <td align="left">
                    <asp:TextBox runat="server" ID="txtRelateProduct" TextMode="MultiLine" Width="600" Height="50"></asp:TextBox>
                    <br />
                    Mỗi sản phẩm cách bởi dấu phẩy(~). Ex: soc ~ doc ~ la
                </td>
            </tr>
            <tr>
                <td align="right" style="font-weight: bold">
                    <span>Tags:</span>
                </td>
                <td align="left">
                    <asp:TextBox ID="txtTags" ValidationGroup="ArticleAdd" runat="server" Width="300px"
                        TextMode="MultiLine" />
                    <AjaxControlToolkit:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server"
                        TargetControlID="txtTags" MinimumPrefixLength="1" CompletionInterval="500" FirstRowSelected="true"
                        CompletionSetCount="15" UseContextKey="True" ServiceMethod="GetCompletionTagList"
                        DelimiterCharacters=", " ShowOnlyCurrentWordInCompletionListItem="true" />
                    Mỗi tag cách bởi dấu phẩy(,). Ex: khách sạn, khach san
                </td>
            </tr>
            <tr>
                <td align="right" style="font-weight: bold">
                    Vị trí:
                </td>
                <td align="left">
                    <asp:TextBox runat="server" ID="txtDisplayOrder" Width="100px" Text="0"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="Chưa nhập vị trí cho sản phẩm"
                        ControlToValidate="txtDisplayOrder" ValidationGroup="ProductAdd" Display="Dynamic">*</asp:RequiredFieldValidator>
                    <asp:RangeValidator ID="RangeValidator1" runat="server" ControlToValidate="txtDisplayOrder"
                        Type="Integer" MinimumValue="0" MaximumValue="9999" ValidationGroup="ProductAdd"
                        ErrorMessage="Vị trí sản phẩm phải từ 0 đến 9999" Display="Dynamic">*</asp:RangeValidator>
                </td>
            </tr>
            <tr>
                <td align="right" style="font-weight: bold">
                </td>
                <td align="left">
                    Ngày đăng:
                    <asp:TextBox ID="txtRealeaseDate" runat="server" Width="200"></asp:TextBox>
                    <AjaxControlToolkit:CalendarExtender ID="CalendarExtender1" Format="dd/MM/yyyy hh:mm:ss tt"
                        runat="server" TargetControlID="txtRealeaseDate">
                    </AjaxControlToolkit:CalendarExtender>
                    <AjaxControlToolkit:MaskedEditExtender ID="MaskedEditExtender1" runat="server" MaskType="DateTime"
                        ClearMaskOnLostFocus="true" TargetControlID="txtRealeaseDate" AcceptAMPM="true"
                        Mask="99/99/9999 99:99:99" AutoComplete="false" InputDirection="LeftToRight"
                        ErrorTooltipEnabled="true" MessageValidatorTip="true">
                    </AjaxControlToolkit:MaskedEditExtender>
                    <AjaxControlToolkit:MaskedEditValidator ID="MaskedEditValidator1" runat="server"
                        ValidationGroup="ArticleAdd" ControlToValidate="txtRealeaseDate" ControlExtender="MaskedEditExtender1"
                        EmptyValueBlurredText="*" InvalidValueBlurredMessage="*" InvalidValueMessage="Sai định dạng ngày tháng năm giờ phút giây"
                        IsValidEmpty="true"> 
                    </AjaxControlToolkit:MaskedEditValidator>
                    <span id="spanClearDateFrom" style="cursor: pointer;">[x]</span> Ngày hết hạn:
                    <asp:TextBox ID="txtExpireDate" runat="server" Width="200"></asp:TextBox>
                    <AjaxControlToolkit:CalendarExtender ID="CalendarExtender2" Format="dd/MM/yyyy hh:mm:ss tt"
                        runat="server" TargetControlID="txtExpireDate">
                    </AjaxControlToolkit:CalendarExtender>
                    <AjaxControlToolkit:MaskedEditExtender ID="MaskedEditExtender2" runat="server" MaskType="DateTime"
                        ClearMaskOnLostFocus="true" TargetControlID="txtExpireDate" AcceptAMPM="true"
                        Mask="99/99/9999 99:99:99" AutoComplete="false" InputDirection="LeftToRight"
                        ErrorTooltipEnabled="true" MessageValidatorTip="true">
                    </AjaxControlToolkit:MaskedEditExtender>
                    <AjaxControlToolkit:MaskedEditValidator ID="MaskedEditValidator2" runat="server"
                        ValidationGroup="ArticleAdd" ControlToValidate="txtExpireDate" ControlExtender="MaskedEditExtender2"
                        EmptyValueBlurredText="*" InvalidValueBlurredMessage="*" InvalidValueMessage="Sai định dạng ngày tháng năm giờ phút giây"
                        IsValidEmpty="true"> 
                    </AjaxControlToolkit:MaskedEditValidator>
                    <span id="spanClearDateTo" style="cursor: pointer;">[x]</span>
                </td>
            </tr>
            <tr>
                <td align="right" style="font-weight: bold">
                </td>
                <td align="left">
                    <asp:CheckBox runat="server" ID="chkCommentsEnable" Text="Cho bình luận" Width="150px" />
                    <asp:CheckBox runat="server" ID="chkOnlyForMember" Text="Dành cho thành viên" Width="150px" />
                </td>
            </tr>
            <tr>
                <td align="right" style="font-weight: bold">
                </td>
                <td align="left">
                    <asp:CheckBox runat="server" ID="chkIsActive" Checked="true" Text="Duyệt sản phẩm" Width="150px" />
                    <asp:CheckBox runat="server" ID="chkTopNews" Text="Sản phẩm nổi bật" Width="150px" />
                </td>
            </tr>
            <tr runat="server" visible="false">
                <td>
                </td>
                <td>
                    <asp:CheckBox ID="chkApprovedComments" runat="server" Width="200px" Text="Tự động duyệt bình luận" />
                </td>
            </tr>
            <tr>
                <td>
                </td>
                <td>
                    <asp:CheckBox ID="chkRatingFix" runat="server" Width="150px" Text="Gán rating" />
                    Rating:
                    <asp:TextBox ID="txtRating" runat="server" Width="200px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="Chưa nhập rating"
                        ControlToValidate="txtRating" ValidationGroup="ProductAdd" Display="Dynamic">*</asp:RequiredFieldValidator>
                    <asp:RangeValidator ID="RangeValidator8" runat="server" ControlToValidate="txtRating"
                        Type="Double" MinimumValue="1" MaximumValue="5" ValidationGroup="ProductAdd"
                        ErrorMessage="rating phải là số thập phân từ 1 đến 5" Display="Dynamic">*</asp:RangeValidator>
                    (rating phải là số thập phân từ 1 đến 5)
                </td>
            </tr>
            <tr runat="server">
                <td>
                </td>
                <td>
                    <asp:CheckBox ID="chkActiveInMenu" runat="server" Width="200px" Text="Hiển thị trên menu" />
                </td>
            </tr>
            <tr>
                <td align="right" style="font-weight: bold">
                    Ngày tạo:
                </td>
                <td align="left">
                    <asp:Label ID="lblAddedDate" runat="server" Text="None"></asp:Label>
                </td>
            </tr>
            <tr>
                <td align="right" style="font-weight: bold">
                    Người tạo:
                </td>
                <td align="left">
                    <asp:Label ID="lblAddedBy" runat="server" Text="None"></asp:Label>
                </td>
            </tr>
            <tr>
                <td align="right" style="font-weight: bold">
                    Ngày update:
                </td>
                <td align="left">
                    <asp:Label ID="lblUpdatedDate" runat="server" Text="None"></asp:Label>
                </td>
            </tr>
            <tr>
                <td align="right" style="font-weight: bold">
                    Người update:
                </td>
                <td align="left">
                    <asp:Label ID="lblUpdatedBy" runat="server" Text="None"></asp:Label>
                </td>
            </tr>
            <tr>
                <td align="right" style="font-weight: bold">
                    Đánh giá:
                </td>
                <td align="left">
                    <asp:Label ID="lblTotalRating" runat="server" Text="None"></asp:Label>
                </td>
            </tr>
            <tr>
                <td align="right" style="font-weight: bold">
                    Lượt xem:
                </td>
                <td align="left">
                    <asp:Label ID="lblTotalViews" runat="server" Text="None"></asp:Label>
                </td>
            </tr>
            <tr>
                <td align="right" style="font-weight: bold">
                    Link:
                </td>
                <td align="left">
                    <asp:Label ID="lbllink" runat="server" Text="None"></asp:Label>
                </td>
            </tr>
            <tr>
                <td>
                </td>
                <td align="left">
                    <asp:Button ID="btnSave" runat="server" ValidationGroup="ProductAdd" Text="Cập nhật sản phẩm"
                        OnClick="btnSave_Click" />
                </td>
            </tr>
        </table>
    </asp:Panel>
</asp:Content>
